/*
 * Copyright (c) 2010 CCX(China) Co.,Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * CCX(China) Co.,Ltd. ("Confidential Information").
 * It may not be copied or reproduced in any manner without the express 
 * written permission of CCX(China) Co.,Ltd.
 *
 * Author: lilei
 * Date: 2011-7-28 ����11:25:01
 */

package com.bj.ccx.business.demo;

import java.io.Serializable;
import Ice.ObjectAdapter;

/**
 * 
 * @author lilei
 */
public class DemoServer implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6340854243354336341L;

	public static void main(String[] args) {
		int status = 0;

		Ice.Communicator ic = null;

		try {

			ic = Ice.Util.initialize();

			ObjectAdapter objAdapter = ic.createObjectAdapterWithEndpoints(
					"demo", "default -h 10.0.2.128 -p 52525");

			Ice.Object servant = new DemoBusinessI();

			objAdapter.add(servant, Ice.Util.stringToIdentity("demoUUID"));

			objAdapter.activate();

			System.out.println("ABCD");
			
			ic.waitForShutdown();
			
			
			
		} catch (Exception e) {
			status = 1;
		} finally {
			
			if (ic != null) {
                ic.destroy();
            }
            System.exit(status);
		}

	}

}
